

/**
 * @author Prinera
 *
 */
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.io.IOException;
import java.net.MalformedURLException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;
package Netzwerk;

public class Server extends UnicastRemoteObject implements ServerInterface
{
  Server() throws RemoteException
  {
    super();
  }
  
  public static void main(String[] args)
  {
    try {
      LocateRegistry.createRegistry(Registry.REGISTRY_PORT);
      System.out.println("Registry wird kreiert...");
    }
    
    catch (RemoteException ex) {
      System.out.println(ex.getMessage());
    }
    try {
      Naming.rebind("Server", new Server());
      System.out.println("Server wird erstellt...");
      System.out.println("'Server' wird angemeldet...");
      
    }
    catch (MalformedURLException ex) {
      System.out.println(ex.getMessage());
    }
    catch (RemoteException ex) {
      System.out.println(ex.getMessage());
    }
  }

	public void method() throws RemoteException {
		System.out.println("Server meldet sich zu Wort!");
	}
	  
}

